package com.neusoft.shopping.manager.dao;

import com.neusoft.shopping.manager.entity.DetailsEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class DetailsDAOImpl {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    RowMapper<DetailsEntity> rowMapper =new BeanPropertyRowMapper<>(DetailsEntity.class);
    public List<DetailsEntity> queryByOrderno(Integer orderno){
        String sql="select * from orderdetails where orderno=?";
        return jdbcTemplate.query(sql,rowMapper,orderno);
    }
}
